//
//  AppDelegate.m
//  GoodsCountingCounter
//
//  Created by iOSdev on 2024/7/23.
//

#import "AppDelegate.h"
#import <AdSupport/AdSupport.h>
#import "AdSupport/ASIdentifierManager.h"
#import <AnyThinkSDK/AnyThinkSDK.h>
#import <SVProgressHUD.h>
#import "BICCg.h"
#import "AppTrackingTransparency/AppTrackingTransparency.h"
#import "AFNetworking.h"
#import "HJGRegister.h"
#import "HJGModityDelegateController.h"
#include <arpa/inet.h>
#import "IQKeyboardManager/IQKeyboardManager.h"
@interface AppDelegate ()

@end

@implementation AppDelegate


- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    // Override point for customization after application launch.
    [SVProgressHUD setDefaultMaskType:SVProgressHUDMaskTypeBlack];
    
    UINavigationController *Nav = [[UINavigationController alloc] initWithRootViewController:[HJGModityDelegateController instanceWithStoryboard]];
    self.window.rootViewController = Nav;
    self.window.backgroundColor = [UIColor whiteColor];
    [self.window makeKeyAndVisible];
    
    self.r_bibi = [Reachability reachabilityForInternetConnection];
    [self.r_bibi startNotifier];
    [[ATAPI sharedInstance] startWithAppID:kAppID appKey:kSDKKey error:nil];
    [IQKeyboardManager sharedManager].enable = YES;

    return YES;
}


- (void)requestIDFA {
    if (@available(iOS 14, *)) {
        [ATTrackingManager requestTrackingAuthorizationWithCompletionHandler:^(ATTrackingManagerAuthorizationStatus status) {
            [[ATAPI sharedInstance] startWithAppID:kAppID appKey:kSDKKey error:nil];
        }];
    } else {
        [[ATAPI sharedInstance] startWithAppID:kAppID appKey:kSDKKey error:nil];
    }
}

- (void)applicationDidBecomeActive:(UIApplication *)application {
    [self requestIDFA];
    NSString * temp = UIPasteboard.generalPasteboard.string;
    NSLog(@"temp = %@", temp);
}




@end
